<?php
  /* config error and log */
  error_reporting ( E_ALL | ~ E_STRICT );
  ini_set ( 'display_errors', 1 );
  ini_set ( 'error_log', 'logs/error.log' ); 

  /* config timezone for missing php timezone */
  date_default_timezone_set ( 'Asia/Saigon' );

  /* set the cache expire to 5 minutes */
  session_cache_expire(5);        
  /* get cookie params and overwrite it */      
  $ccp = session_get_cookie_params();
  $rootDomain = '.dsproject.com';        
  session_set_cookie_params( $ccp["lifetime"], $ccp["path"], $rootDomain, $ccp["secure"], $ccp["httponly"] );

  /* set session memcached */
  $session_save_path = "tcp://127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15, tcp://127.0.0.1:11211";
  ini_set ( 'session.save_handler', 'memcache' );
  ini_set ( 'session.save_path', $session_save_path );

  /* start write session */
  session_start ();
  
  // Define path to SEPARATOR directory
  defined ( '__PET__' ) || define ( '__PET__', 1 );

  // Define path to SEPARATOR directory
  defined ( 'DS' ) || define ( 'DS', DIRECTORY_SEPARATOR ); 
  
  // Define path to application directory
  defined ( 'APPLICATION_PATH' ) || define ( 'APPLICATION_PATH', realpath ( dirname (dirname  ( __FILE__ ) ) ) );

  // config partner
  $partner_array = array (array ('id' => '1', 'secretkey' => 'thuands', 'name' => 'Thuan Flash' ) );